package com.winit.common.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ListUtil {

    public static List<String> addChild(List<String> child, String id) {
        if (null == child) {
            child = new ArrayList<>();
        }
        child.add(id);
        return child;
    }

    public static List<String> removeChild(List<String> child, String id) {
        if (null == child) {
            return new ArrayList<>();
        }
        child.remove(id);
        return child;
    }

    public static List<String> saveChild(String ids) {
        String[] s = ids.split(",");
        List<String> child = Arrays.asList(s);
        return child;
    }
}
